package com.bodu.exchange.controller;

import com.bodu.core.entity.ParamReq;
import com.bodu.core.entity.result.Result;
import com.bodu.exchange.client.ExchangeBillClient;
import com.bodu.exchange.entity.request.ExchangeBillRequest;
import com.bodu.exchange.entity.vo.ExchangeBillVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author Administrator
 */
@RestController
@Api(value = "bill API", tags = "bill API")
@RequestMapping("api/exchange-bill")
public class ExchangeBillApiController {
    
    @Autowired
    private ExchangeBillClient exchangeBillClient;

    @ApiModelProperty("创建")
    @PostMapping("createBill")
    public Result<Long> createBill(@RequestBody ExchangeBillRequest exchangeBillTypeRequest) {
        return exchangeBillClient.createBill(exchangeBillTypeRequest);
    }

    @ApiModelProperty("删除")
    @GetMapping("deleteBill/{id}")
    public Result<Long> deleteBill(@PathVariable("id") Long id) {
        return exchangeBillClient.deleteBill(id);
    }
    
    @ApiModelProperty("查询")
    @PostMapping("billList")
    public Result<ExchangeBillVo> billList(@RequestBody ParamReq<ExchangeBillRequest> request) {
        return exchangeBillClient.billList(request);
    }
    
    
}
